package cn.tedu.spring.config;

import cn.tedu.spring.eg1.Product;
import cn.tedu.spring.file.Database;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author lhd
 * @date 2024/4/17
 * @apiNote
 */
public class TestSpringConfig {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);

        //获取Database的Bean对象
        Database database = context.getBean(Database.class);
        System.out.println(database);

        //获取Product的Bean对象
        Product product = context.getBean(Product.class);
        System.out.println(product);
    }
}
